import { defHttp } from '/@/utils/http/axios';

// 查询项目
export function getProjectManagementList(data) {
  return defHttp.post({
    url: '/v1/company/project/query',
    data,
  });
}

// 删除项目
export function delProjectManagementList(data) {
  return defHttp.post({
    url: '/v1/company/project/remove',
    data,
  });
}
// 修改项目
export function updataProjectManagementList(data) {
  return defHttp.post({
    url: '/v1/company/project/modify',
    data,
  });
}

// 新增项目
export function addProjectManagementList(data) {
  return defHttp.post({
    url: '/v1/company/project/create',
    data,
  });
}

// 文件上传
export function fileUploadApi(fromData) {
  return defHttp.post({
    url: '/v1/file/upload',
    params: fromData,
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
  });
}

// 文件查看
export function fileViewApi(url) {
  return defHttp.get({
    url: `/v1/file/view?url=${url}`,
  });
}
// 文件下载
export function fileDownloadApi(url) {
  return defHttp.get({
    url: `/v1/file/download?url=${url}`,
    responseType: 'blob',
  });
}

// 查询项目记录
export function logQueryApi(data) {
  return defHttp.post({
    url: '/v1/company/project/log/query',
    data,
  });
}

// 查询全部项目记录
export function logAllQueryApi(data) {
  return defHttp.post({
    url: '/v1/company/project/log/all/query',
    data,
  });
}

// 删除发票记录
export function removeFapiao(data) {
  return defHttp.post({
    url: '/v1/company/project/invoice/remove',
    data,
  });
}

// 删除出图记录
export function removeChutu(data) {
  return defHttp.post({
    url: '/v1/company/project/design/remove',
    data,
  });
}

// 删除招投标记录
export function removeZhaoTouBiao(data) {
  return defHttp.post({
    url: '/v1/company/project/tender/remove',
    data,
  });
}
// 删除合同记录
export function removeHetong(data) {
  return defHttp.post({
    url: '/v1/company/project/contract/remove',
    data,
  });
}
// 删除验收记录
export function removeYanshou(data) {
  return defHttp.post({
    url: '/v1/company/project/check/remove',
    data,
  });
}

// -----------------------------------

// 修改发票记录审核状态
export function modifyFapiaoAuditState(data) {
  return defHttp.post({
    url: '/v1/company/project/invoice/apply/stage/modify',
    data,
  });
}

// 修改出图记录审核状态
export function modifyChutuAuditState(data) {
  return defHttp.post({
    url: '/v1/company/project/design/apply/stage/modify',
    data,
  });
}

// 修改招投标记录审核状态
export function modifyZhaoTouBiaoAuditState(data) {
  return defHttp.post({
    url: '/v1/company/project/tender/apply/stage/modify',
    data,
  });
}
// 修改合同记录审核状态
export function modifyHetongAuditState(data) {
  return defHttp.post({
    url: '/v1/company/project/contract/apply/stage/modify',
    data,
  });
}
// 修改验收记录审核状态
export function modifyYanshouAuditState(data) {
  return defHttp.post({
    url: '/v1/company/project/check/apply/stage/modify',
    data,
  });
}

// 查询全部项目申请记录
export function applyLogAllQueryApi(data) {
  return defHttp.post({
    url: '/v1/company/project/apply/log/all/query',
    data,
  });
}

// 删除发票申请记录
export function removeFapiaoApply(data) {
  return defHttp.post({
    url: '/v1/company/project/invoice/apply/remove',
    data,
  });
}

// 删除出图申请记录
export function removeChutuApply(data) {
  return defHttp.post({
    url: '/v1/company/project/design/apply/remove',
    data,
  });
}

// 删除招投标申请记录
export function removeZhaoTouBiaoApply(data) {
  return defHttp.post({
    url: '/v1/company/project/tender/apply/remove',
    data,
  });
}
// 删除合同申请记录
export function removeHetongApply(data) {
  return defHttp.post({
    url: '/v1/company/project/contract/apply/remove',
    data,
  });
}
// 删除验收申请记录
export function removeYanshouApply(data) {
  return defHttp.post({
    url: '/v1/company/project/check/apply/remove',
    data,
  });
}

// 查询记录类型
export function getLogTypeQuery() {
  return defHttp.post({
    url: '/v1/company/project/log/type/query',
  });
}

// 查询我的项目
export function getProjectMyQueryaApi(data) {
  return defHttp.post({
    url: '/v1/company/project/my/query',
    data,
  });
}

// 查询我的公司信息 (当前)
export function getMyCompanyInfoApi() {
  return defHttp.post({
    url: '/v1/company/my/view',
  });
}

// 查询每个项目申请记录条数
export function getApplyLogNumberQueryApi(data) {
  return defHttp.post({
    url: '/v1/company/project/apply/log/number/query',
    data,
  });
}
